package pl.PawelAndAlicja.badugiproject.main.Cards;

public class FlyweightCard {

// --Commented out by Inspection START (2014-10-25 03:01):
//    FlyweightCard(String cardName) {
//        if (cardName.equals("King")) {
//            this.power = 13;
//        } else if (cardName.equals("Queen")){
//            this.power = 12;
//        } else if (cardName.equals("Jack")){
//            this.power = 11;
//        } else if (cardName.equals("10")){
//            this.power = 10;
//        } else if (cardName.equals("9")){
//            this.power = 9;
//        } else if (cardName.equals("8")){
//            this.power = 8;
//        } else if (cardName.equals("7")){
//            this.power = 7;
//        } else if (cardName.equals("6")){
//            this.power = 6;
//        } else if (cardName.equals("5")){
//            this.power = 5;
//        } else if (cardName.equals("4")){
//            this.power = 4;
//        } else if (cardName.equals("3")){
//            this.power = 3;
//        } else if (cardName.equals("2")){
//            this.power = 2;
//        } else if (cardName.equals("Ace")) {
//            this.power = 1;
//        } else {
//            this.power =0;
//        }
//
//        this.name = cardName;
//        this.type = null;
//        this.hidden = true;
//    }
// --Commented out by Inspection STOP (2014-10-25 03:01)

// --Commented out by Inspection START (2014-10-25 03:02):
//    FlyweightCard(int power) {
//        if (power == 13) {
//            this.name = "King";
//        } else if (power == 12){
//            this.name = "Queen";
//        } else if (power == 11){
//            this.name = "Jack";
//        } else if (power == 10){
//            this.name = "10";
//        } else if (power == 9){
//            this.name = "9";
//        } else if (power == 8){
//            this.name = "8";
//        } else if (power == 7){
//            this.name = "7";
//        } else if (power == 6){
//            this.name = "6";
//        } else if (power == 5){
//            this.name = "5";
//        } else if (power == 4){
//            this.name = "4";
//        } else if (power == 3){
//            this.name = "3";
//        } else if (power == 2){
//            this.name = "2";
//        } else if (power == 1){
//            this.name = "Ace";
//        } else {
//            this.name = "NaN";
//        }
//        this.power = power;
//        this.hidden = true;
//        this.type = null;
//    }
// --Commented out by Inspection STOP (2014-10-25 03:02)

    FlyweightCard(String cardName, String typeCard) {
        if (cardName.equals("King")) {
            this.power = 13;
        } else if (cardName.equals("Queen")){
            this.power = 12;
        } else if (cardName.equals("Jack")){
            this.power = 11;
        } else if (cardName.equals("10")){
            this.power = 10;
        } else if (cardName.equals("9")){
            this.power = 9;
        } else if (cardName.equals("8")){
            this.power = 8;
        } else if (cardName.equals("7")){
            this.power = 7;
        } else if (cardName.equals("6")){
            this.power = 6;
        } else if (cardName.equals("5")){
            this.power = 5;
        } else if (cardName.equals("4")){
            this.power = 4;
        } else if (cardName.equals("3")){
            this.power = 3;
        } else if (cardName.equals("2")){
            this.power = 2;
        } else if (cardName.equals("Ace")) {
            this.power = 1;
        } else {
            this.power =0;
        }

        this.name = cardName;
        this.type = typeCard;
        this.hidden = true;
    }

    FlyweightCard(int power, String typeCard) {
        if (power == 13) {
            this.name = "King";
        } else if (power == 12){
            this.name = "Queen";
        } else if (power == 11){
            this.name = "Jack";
        } else if (power == 10){
            this.name = "10";
        } else if (power == 9){
            this.name = "9";
        } else if (power == 8){
            this.name = "8";
        } else if (power == 7){
            this.name = "7";
        } else if (power == 6){
            this.name = "6";
        } else if (power == 5){
            this.name = "5";
        } else if (power == 4){
            this.name = "4";
        } else if (power == 3){
            this.name = "3";
        } else if (power == 2){
            this.name = "2";
        } else if (power == 1){
            this.name = "Ace";
        } else {
            this.name = "NaN";
        }
        this.power = power;
        this.hidden = true;
        this.type = typeCard;
    }

    @Override
    public String toString() {
        return this.name + " " + this.type;
    }

    public String getName() {
        return this.name;
    }

    public int getPower() {
        return power;
    }

    public String getType() {
        return this.type;
    }

    public boolean isHidden() {
        return hidden;
    }

    private final String name;
    private final boolean hidden;
    private final int power;
    private final String type;
}
